<template>
    <div class="content">
        <!--<div class="qrcode">
            <img src="" style="width:100%;height: 350px;" />
        </div>
        <template>
            <van-divider :style="{ color: '#1989fa', borderColor: '#1989fa', padding: '0 16px' }">
                客服联系电话
            </van-divider>
            <div style="text-align: center; font-size: 22px;">88888888</div>
        </template>-->
    </div>
</template>

<script>
import { getOpenidInfo, toLST } from '@/api/yi-qing-fang-kong.js'

export default {
  data () {
    return {
      userInfo: {},
      loading: false
    }
  },
  methods: {
    init () {
      getOpenidInfo().then(ret => {
        if (ret.data.errcode === 0) {
          // console.log('获取人员信息', this.userInfo)
          this.userInfo = ret.data.data
          if (this.$common.xeUtils.isEmpty(this.userInfo)) {
            window.location.href = 'http://lst.lnzwfw.gov.cn:8089/dist/index.html#/tbchoose'
          } else {
            let userName = this.userInfo.name ? this.userInfo.name : '' // 姓名
            let loginName = this.userInfo.openid ? this.userInfo.openid : '' // 用户名
            let phone = this.userInfo.phone ? this.userInfo.phone : '' // 电话号码
            let cardNo = this.userInfo.card_no ? this.userInfo.card_no : '' // 身份证号
            let userLevel = 'RC03' // 用户实名认证情况 *页面验证 –> RC03 / RC04 / RC05
            let completeInfo = '' // 用户完善信息情况 *页面验证 –>  等于空值就可以
            let token = this.userInfo.openid ? this.userInfo.openid : ''
            window.location.href = 'http://lst.lnzwfw.gov.cn:8089/dist/index.html#/tbchoose?' +
'username=' + userName +
'&loginName=' + loginName +
'&phone=' + phone +
'&cardNo=' + cardNo +
'&userLevel=' + userLevel +
'&completeInfo=' + completeInfo +
'&token=' + token
          }
        } else {
          this.failNotice(ret.data.errmsg)
        }
      })
    },
    toLSTAction () {
      toLST().then(ret => {
        if (ret.data.data.url === '') {
          this.$router.push({ name: 'epidemic-submit-new' })
        } else {
          window.location.href = 'http://lst.lnzwfw.gov.cn:8089/dist/index.html#/registerother?' + ret.data.data.url
        }
      })
    }
  },
  mounted () {
    this.toLSTAction()
  }
}
</script>

<style scoped>
    .qrcode {
        margin: 20px;
    }
</style>
